package cn.mw.cmdb.processor;

import cn.mw.cmdb.service.ServiceAction;
import cn.mw.microMonitorCommon.security.dto.MwUser;
import org.springframework.context.ApplicationEvent;
import org.springframework.security.core.Authentication;

public class BusinessProcessEvent extends ApplicationEvent {
    private Authentication authentication;

    // 每次请求的参数
    private Object destObj;
    // 增删改查 的返回结构
    private Object ret;
    private ServiceAction action;

    public BusinessProcessEvent(Object source, Object destObj, Object ret, ServiceAction action ,Authentication authentication) {
        super(source);
        this.destObj = destObj;
        this.ret = ret;
        this.action = action;
        this.authentication = authentication;
    }

    public Object getDestObj() {
        return destObj;
    }

    public Object getRet() {
        return ret;
    }

    public ServiceAction getAction() {
        return action;
    }

    @Override
    public String toString() {
        return "BusinessProcessEvent{" +
                "destObj=" + destObj +
                ", ret=" + ret +
                ", action=" + action +
                '}';
    }

    public Authentication getAuthentication() {
        return authentication;
    }
}
